<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="dao.GoodDao" %>
<%@ page import="dao.impl.GoodDaoImpl" %>
<%@ page import="po.Good" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
</head>
<body>
<%
    String goodid = request.getParameter("goodid");
    System.out.println("goodid="+goodid);
    String goodname = request.getParameter("goodname");
    String type=request.getParameter("type");
    int count = Integer.parseInt(request.getParameter("count"));
    double cost = Double.parseDouble(request.getParameter("cost"));

    GoodDao goodDao=new GoodDaoImpl();
    Good good=goodDao.getGood(goodid);
    good.setGoodName(goodname);
    good.setType(type);
    good.setCount(count);
    good.setCost(cost);

    goodDao.updateGood(good);
    response.sendRedirect("goodManage.jsp");
%>
</body>
</html>
